package org.jsola.contract.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import javax.validation.constraints.NotNull;

import static org.jsola.contract.example.VariableExample.E_NAME;
import static org.jsola.contract.example.VariableExample.E_NEED;
import static org.jsola.contract.example.VariableExample.E_TYPE;
import static org.jsola.contract.example.VariableExample.M_NAME_MAX;
import static org.jsola.contract.example.VariableExample.M_NAME_NOT_NULL;
import static org.jsola.contract.example.VariableExample.M_TYPE_MAX;
import static org.jsola.contract.example.VariableExample.N_NAME;
import static org.jsola.contract.example.VariableExample.N_NEED;
import static org.jsola.contract.example.VariableExample.N_TYPE;

/**
 * 模板变量
 *
 * @author JanusMix
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【模板变量】的参数")
@Data
public class VariableAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_NAME, example = E_NAME, required = true)
    @NotNull(message = M_NAME_NOT_NULL)
    @Length(max = 255, message = M_NAME_MAX)
    private String name;

    @ApiModelProperty(notes = N_TYPE, example = E_TYPE)
    @Length(max = 255, message = M_TYPE_MAX)
    private String type;

    @ApiModelProperty(notes = N_NEED, example = E_NEED)
    private Boolean need;


}

